package com.ruoyi.cms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cms.mapper.CmsSiteArticleMapper;
import com.ruoyi.cms.domain.CmsSiteArticle;
import com.ruoyi.cms.service.ICmsSiteArticleService;

/**
 * 站点文章Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-23
 */
@Service
public class CmsSiteArticleServiceImpl implements ICmsSiteArticleService 
{
    @Autowired
    private CmsSiteArticleMapper cmsSiteArticleMapper;

    /**
     * 查询站点文章
     * 
     * @param id 站点文章主键
     * @return 站点文章
     */
    @Override
    public CmsSiteArticle selectCmsSiteArticleById(Long id)
    {
        return cmsSiteArticleMapper.selectCmsSiteArticleById(id);
    }

    /**
     * 查询站点文章列表
     * 
     * @param cmsSiteArticle 站点文章
     * @return 站点文章
     */
    @Override
    public List<CmsSiteArticle> selectCmsSiteArticleList(CmsSiteArticle cmsSiteArticle)
    {
        return cmsSiteArticleMapper.selectCmsSiteArticleList(cmsSiteArticle);
    }

    /**
     * 新增站点文章
     * 
     * @param cmsSiteArticle 站点文章
     * @return 结果
     */
    @Override
    public int insertCmsSiteArticle(CmsSiteArticle cmsSiteArticle)
    {
        cmsSiteArticle.setCreateTime(DateUtils.getNowDate());
        return cmsSiteArticleMapper.insertCmsSiteArticle(cmsSiteArticle);
    }

    /**
     * 修改站点文章
     * 
     * @param cmsSiteArticle 站点文章
     * @return 结果
     */
    @Override
    public int updateCmsSiteArticle(CmsSiteArticle cmsSiteArticle)
    {
        cmsSiteArticle.setUpdateTime(DateUtils.getNowDate());
        return cmsSiteArticleMapper.updateCmsSiteArticle(cmsSiteArticle);
    }

    /**
     * 批量删除站点文章
     * 
     * @param ids 需要删除的站点文章主键
     * @return 结果
     */
    @Override
    public int deleteCmsSiteArticleByIds(Long[] ids)
    {
        return cmsSiteArticleMapper.deleteCmsSiteArticleByIds(ids);
    }

    /**
     * 删除站点文章信息
     * 
     * @param id 站点文章主键
     * @return 结果
     */
    @Override
    public int deleteCmsSiteArticleById(Long id)
    {
        return cmsSiteArticleMapper.deleteCmsSiteArticleById(id);
    }
}
